/*
*编写程序比较两个string类型的字符串
*然后编写另一个程序比较两个C风格的字符串的值
*/
#include <iostream>
#include <string>
using namespace std;

int main()
{	
	//比较两个string类型的字符串
	cout << "string类型字符串：" << endl;
	string str1 = "Hello";
	string str2 = "Hello";
	if(str1 == str2)
	{
		cout << str1 << " = "  << str2;
	}
	else if(str1 > str2)
	{
		cout << str1 << " > "  << str2;
	}
	else
	{
		cout << str1 << " < "  << str2;
	}
	cout << endl;

	//比较两个C风格字符串的值
	cout << "C风格字符串：" << endl;
	const int cSize = 6;
	char cstring1[cSize] = "Hello";
	char cstring2[cSize] = "Hello";
	
	if(strcmp(cstring1,cstring2))
	{
		cout << "cstring1 = cstring2";
	}
	else
	{
		cout << "cstring1 != cstring2";
	}
	cout << endl;

	system("pause");
	return 0;
}